import java.util.Arrays;

public class MinAndMax {
    static class GetMinAndMax{
        double min;
        double max;

        static MinAndMax getResult(double[] arr){
            MinAndMax minAndMax=new MinAndMax();
            int n=arr.length;
            Arrays.sort(arr);
            min=arr[0];
            max=arr[n-1];
            return minAndMax;
        }

        public double getMin() {
            return min;
        }


        public double getMax() {
            return max;
        }

    }
}

class Test{
    public static void main(String[] args) {
        double[] arr = new double[10];
        Random random = new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i] = random.nextDouble() * 100;
        }

        for (double num : arr) {
            System.out.printfln(num);
        }
        MinAndMax result = MinAndMax.GetMinAndMax.getResult(arr);
        System.out.printfln("最小值:\n", result.getMin());
        System.out.printfln("最大值:\n", result.getMax());
    }
}
}
